﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NaturalNote.Core.Database
{
    public interface IDataStorage
    {
        Task ExecSql(string sql, object? param = null);
        Task Insert<T>(T entity) where T : class, new();
        Task Insert<T>(IEnumerable<T> entitys) where T : class, new();
        Task Save<T>(T entity) where T : class, new();
        Task Save<T>(IEnumerable<T> entitys) where T : class, new();
        
        Task Update<T>(T enity) where T : class, new();
        Task Update<T>(T enity, object param) where T : class, new();
        Task Update(string table, object data, object param);

        Task Delete<T>(T entity) where T : class, new();
        Task Delete<T>(IEnumerable<T> entities) where T : class, new();
        Task Delete(string table, object? param = null);
    }
}
